This invention relates to a method of controlling a disk device by a disk control unit. More particularly, the invention relates to a method of controlling a disk device by a disk control unit provided between a host device and a disk device for performing an emulation (format conversion) between a CKD format and an FBA format in memory and accessing the disk device in fixed-length units.
A magnetic disk subsystem has a direct-access storage device (DASD) serving as an I/O device, and a disk control unit provided between a host device and the direct-access storage device for controlling the writing of data to the direct-access storage device and the reading of data from the direct-access storage device.
Since the direct-access storage device performs a mechanical operation, it is difficult to achieve a high speed in which access time is on the order of milliseconds. The access time attained is significantly less than that of a semiconductor memory. Accordingly, a disk control unit internally equipped with a cache memory for the purpose of raising access speed has been made available. This device, which utilizes the fact that access from the host tends to concentrate on specific data in the direct-access storage device, copies data referred to frequently to the cache memory and, when re-access to the copied data is required, transfers the data directly from the cache memory rather than access the data in the direct-access storage device. Since the data is rearranged based upon an LRU (least recently used) algorithm, data having a high frequency of access at the time is retained. Thus, data having a high frequency of access does not require a mechanical operation, thereby making it possible to greatly shorten I/O response time.
FIG. 2 is a diagram showing the configuration of a system which includes a disk control unit (DCU) equipped with a cache memory. Numeral 10 denotes a host device (CPU) provided with a plurality of channels 20a, 20b, 20c . . . a disk control unit (DCU) 30 and direct-access storage devices (DASD) 40a.about.40f.
The disk control unit 30 includes channel adapters (CA) 31a.about.31c and 31a'.about.31c ' for interfacing the host device 10, device adapters (DA) 32a.about.32c and 32a'.about.32c ' for interfacing the direct-access storage devices, a cache memory 33, cache function engines (CFE) 34a, 34a' for managing the cache memory and executing processing such as a hit/miss decision, resource managers (RM) 35a, 35a' for performing control related to overall resource management and processing operations, service adapters (SA) 36a, 36a' for executing IML (initial microprogram loading), status monitoring processing and malfunction recovery processing with regard to each of the units, and non-volatile memories (PS) 37a, 37a', such as magnetic disk devices, for storing microprograms for control of each unit.
The foregoing units are interconnected by buses 38a, 38a', each of which has a C-BUS, a D-BUS and an S-BUS, not shown. The C-BUS is a control bus through which each unit communicates messages and accesses control information, the D-BUS is a data transfer bus through which each unit performs an exchange of data, and the S-bus is a service bus through which the service adapters 36a, 36a' serve as masters for managing the status of each unit. A control panel, not shown, is connected to the service adapters 36a. 36a'.
The disk control unit of FIG. 2 has a redundant structure arranged in symmetrical left and right halves about a center dashed line (G0 represents a first controller side or Group 0 and G1 represents a second controller side or Group 1). The cache memory 33 constitutes a common or shared module. The CPU 10 is connected to the channel adapters CA of the first controller side G0 and second controller side G1 via prescribed channels, and the direct-access storage devices (DASD) 40a.about.40f are capable of being accessed from the first controller side G0 and second controller side G1. Accordingly, even if channel adapters or device adapters on one side fail, the CPU 10 can still access the direct-access storage devices from the channel adapters or devices adapters on the other side.
The channel adapters 31a.about.31c', device adapters 32a.about.32c ', cache function engines 34a.about.34a', resource managers 35a.about.35a' and service adapters 36a, 36a' are each constituted by a microprocessor and generally have the construction shown in FIG. 3. Specifically, each device includes a microprocessor (MPU) 51, a control store (CS) 52 comprising a RAM, a control store (CS) 53 comprising a ROM, a driver/receiver (DV/RV) 54 connected to the internal buses 38a, 38a', bus interface logic (BIL) 55, a driver/receiver (DV/RV) 56 connected to an external interface, a buffer or control table store (TS) 57 and a separate LSI (gate array) 58. The control table store 57 of the resource managers 35a, 35a' store various control tables, such as an exclusive management table EAT (not shown), a path group table PGT and a physical construction table PCT, by way of example.
Data is stored on each track of a direct-access storage device in accordance with a CKD format. FIG. 4 is a diagram for describing the CKD data format. The track has several areas demarcated by gaps and is provided at its head with an index mark. A home address area provided after the index mark HA is an area which describes the address of the track on which it is present. A plurality of records R0, R1, R2, . . . composed of a count area C, key area K and data area D are written after the home address area. A track address CCHH (where CC represents a cylinder address and HH represents a head address), a record number R and lengths of the succeeding key and data areas, etc., are written in the counter area C. Accordingly, the individual records can be designated by designating the track address and record number. It is not always necessary to write a retrieval key in the key area K. User data is written in the data area D. It should be noted that the record R0 at the head of the track is composed of a count area C and data area D and does not have a key area.
In accordance with the disk control unit (DCU) 30, data is read and written in the manner described below. FIGS. 5 and 6 are diagrams for describing the flow of a record when data is read. FIG. 5 illustrates the flow in a case where a read hit is not achieved (a case in which a read record is not present in the cache memory), and FIG. 6 shows the flow when there is a read hit. A buffer BF incorporated within the cache function engine CFE stores an address (CCHHR) of a record present in the cache memory CM and a flag FLAG indicating whether the record has been saved in a direct-access storage device DASD (where "1" logic in the flag indicates that the record has not been saved and "0" indicates that the record has been saved).
When a seek command SK is issued by a channel device CH, the channel adapter CA queues the seek command in a command queue and subsequently sends an operation-finished signal back to the channel device CH to make it appear that the seek operation has ended. The channel device CH issues a set-sector command SS in response to reception of the seek operation-finished signal. When this command is received, the channel adapter CA queues the command and then sends an operation-finished signal back to the channel device CH to make it appear that the set-sector operation has ended. The channel device CH issues a search ID command SID in response to reception of the set-sector operation-finished signal. When this command is received, the channel adapter CA inquires of the cache function engine CFE whether the record of the requested address (CCHHR) is present in the cache memory CM.
If the requested record is not present in the cache memory CM, then the channel adapter CA informs the resource manager RM of this fact and issues a retry signal in order to cut off the channel device CH from the disk control unit DCU. In response to reception of the retry signal, the channel device CH is temporarily cut off from the disk control unit DCU and is capable of executing services for another disk control unit during this time. Further, in a case where a command request signal is received subsequently after the channel device CH is cut off in response to reception of the retry signal, the command issued immediately prior thereto (the search ID command in this example) is re-sent.
The resource manager RM refers to the exclusive control table to verify that the direct-access storage device sought is not in the process of being accessed, determines the prescribed device adapter DA, notifies the channel adapter CA of the identification data of this device adapter and notifies this device adapter DA of the identification data of the channel adapter.
The channel adapter CA delivers the CKD track position (CCHH) contained in the seek command to the notified device adapter DA and designates staging. When staging is designated, the device adapter DA reads one designated CKD track (CCHH) of data and notifies the resource manager RM of designation of recombination with the channel device CH. Further, the device adapter DA writes the read data in the cache memory CM (see FIG. 5). After the writing operation, the device adapter DA notifies the cache function engine CFE of end of staging.
Then, in response to designation from the resource manager RM, the channel adapter CA sends a command request signal to the channel device CH. Upon receiving the command request, the channel device CH reissues the search ID command SID issued last. If the channel adapter CA receives the search ID command SID, it retrieves the designated record in the cache memory CM and sends a search ID operation-finished signal to the channel device CH in response to end of retrieval. If the channel device CH receives the search ID operation-finished signal, it issues a read command RD. If the channel adapter CA receives the read command RD, it reads the searched record out of the cache memory CM and transfers this record to the channel device CH (see arrow B in FIG. 5).
If, on the other hand, the record requested by the search ID is present in the cache memory CM (read hit), the channel adapter CA sends a command request signal to the channel device CH. Upon receiving the command request, the channel device CH issues the read command RD. Upon receiving the read command RD, the channel adapter CA reads the requested record out of the cache memory CM and transfers it to the channel device CH. (see arrow C in FIG. 6).
FIGS. 7 and 8 are diagrams for describing the flow of a record when data is written. FIG. 7 illustrates the flow in write-thru, and FIG. 8 shows the flow when there is a write hit.
When the seek command SK is issued by a channel device CH, the channel adapter CA queues the seek command in a command queue and subsequently sends an operation-finished signal back to the channel device CH to make it appear that the seek operation has ended. The channel device CH issues the set-sector command SS in response to reception of the seek operation-finished signal. When this command is received, the channel adapter CA queues the command and then sends an operation-finished signal back to the channel device CH to make it appear that the set-sector operation has ended. The channel device CH issues the search ID command SID in response to reception of the set-sector operation-finished signal. When this command is received, the channel adapter CA inquires of the cache function engine CFE whether the record of the requested address (CCHHR) is present in the cache memory CM.
If the requested record is not present in the cache memory CM, then the channel adapter CA informs the resource manager RM of this fact and issues a retry signal in order to cut off the channel device CH from the disk control unit DCU. In response to reception of the retry signal, the channel device CH is temporarily cut off from the disk control unit DCU.
The resource manager RM refers to the exclusive control table to verify that the direct-access storage device DASD sought is not in the process of being accessed, determines the prescribed device adapter DA, notifies the channel adapter CA of the identification data of this device adapter and notifies this device adapter DA of the identification data of the channel adapter CA.
The channel adapter CA delivers the position parameter (CCHH) contained in the seek command to the notified device adapter DA, causes the direct-access storage device DASD to execute a seek operation, delivers the position parameter (sector value) contained in the set-sector command in response to completion of the seek operation and causes the direct-access storage device DASD to execute the set-sector operation in similar fashion. If the set-sector operation is completed, the channel adapter CA sends a channel-command request signal to the channel device. Upon receiving the command request, the channel device CH reissues the search ID command SID issued last. If the channel adapter CA receives the search ID command SID, it delivers the parameter (record number R) of the search ID to the device adapter DA, causes the direct-access storage device DASD to execute the search ID operation and, if the search operation is completed, sends the operation-finished signal to the channel device CH.
If the channel device CH receives the search operation-finished signal, it issues a read command RD. If the channel adapter CA receives the read command RD, it writes the data (the record) in the cache memory CM and also writes the data in the command address CCHHR of the direct-access storage device DASD via the device adapter DA (see arrows D and E in FIG. 7). Furthermore, the address (CCHHR) (flag "0") of the written record is stored in the memory of the cache function engine CFE.
The foregoing processing is referred to as "write-thru". In write-thru, the record is written in the direct-access storage device DASD in concurrence with the writing of the record in the cache memory. The result is a low access speed. Accordingly, a disk control device also is available in which access speed is raised by providing a non-volatile memory NVS within he disk control unit DCU and terminating the writing operation upon writing the record in the non-volatile memory in concurrence with the writing of the record in the cache memory.
If, on the other hand, the record at the address (CCHHR) requested by the search ID is present in the cache memory CM (write hit), the channel adapter CA sends a command request signal to the channel device CH. Upon receiving the command request, the channel device CH issues the write command WD. Upon receiving the write command WD, the channel adapter CA rewrites the record of CCHHR that has been stored in the cache memory CM (see arrow F in FIG. 8). At this time the flag corresponding to CCHHR stored in the memory of the cache function engine CFE is changed to "1". Thereafter, independently of the operation of the host, the disk control unit writes the record of CCHHR for which the flag is "1" from the cache memory CM to the direct-access storage device DASD (this is referred to as "write-back"; see arrow G in FIG. 8) and makes the flag "0" in response to write-back.
In a case where the operating system (OS) is handling data using the CKD format, only a disk device (CKD disk device) premised on the CKD format can be connected to the disk control unit DCU.
In recent years, advances in technology have made it possible to greatly increase the capacity of an FBA (fixed-block architecture) disk device possessing an interface such as an SCSI, and it is becoming possible to realize a capacity comparable with that of the conventional CKD disk device. In comparison with the CKD disk device, for which the utilization environment is limited, an FBA disk device is superior is terms of price, power consumption and area needed for installation.
As shown in FIG. 9, the FBA format is such that the lengths of all logic blocks (FBA blocks) are equal, with one CKD track being partitioned into a prescribed number of FBA blocks. The FBA blocks have identification numbers 1, 2, 3 . . . specific to them, and a 64-byte ID portion (an ID portion for COF) for a CKD.multidot.FBA format conversion (COF conversion: CKD ON FBA) is provided at the head of each FBA block. Further, an ID portion (block ID portion for FBA) storing the FBA block address (the identification umber of the FBA block) is provided ahead of each FBA block.
Such an FBA disk device is small in size and low in price and maintains a performance that allows it to be used fully as an external storage device for a large-scale computer system.
According to a CKD control method, it is required that the CKD format transferred from the host device be converted to the FBA format within the disk control unit in order that the FBA disk device can be applied to a system in which the host device handles data (see FIG. 10). Further, in a case where FBA block data is read from an FBA disk via an SCSI interface, it is required that the FBA block data be transferred to the host device after it is converted to the CKD format.
An effective method of performing the CKD.multidot.FBA format conversion (COF conversion) is not available in the prior art. In particular, in a case where use is made of the CKD disk device, the disk control unit reads a record upon performing a positioning operation conforming to the seek command, set-sector command and search ID command from the host device. However, in a case where the FBA disk device is used, it is not possible in the prior art to perform control similar to that in the case of the CKD disk by a seek command, set-sector command and search ID. Accordingly, the inventors have proposed, in the specification of Japanese Patent Application No. 5-286339 (filed on Nov. 16, 1993), a method of controlling a disk control unit so adapted that even if the disk device is an FBA disk device, control can be carried out in the same manner as performed in the case of a CKD disk device.
In accordance with this proposed control method, control can be carried out in the same manner as performed in the case of a CKD disk device even if the device is an FBA disk device. However, there is room for improvement since the proposed method is inadequate in terms of the improvements in efficiency and speed of the read and write operations of the FBA disk device.
Further, in the proposed method described above, consideration is not given to case where write processing from the host device is interrupted while in progress or to a case where a defect develops in a track of the FBA disk.